﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Yatagan.Configuration.Elements;
using System.Xml;

namespace Yatagan.Configuration
{
    public class Configuration
    {
        #region Singleton

        private Configuration() { }

        private readonly static Configuration _current = new Configuration();

        public static Configuration Current
        {
            get { return _current; }
        }

        #endregion

        #region Properties

        public string Path { get; set; }

        #endregion

        public void LoadConfiguration(string path)
        {
            Path = path;

            XmlDocument document = new XmlDocument();
            document.Load(Path);

            Element = new Configurations(document.SelectSingleNode("Configurations"));
        }

        public Configurations Element { get; private set; }
    }
}
